package priv.ln.team.domain;

import priv.ln.team.service.Status;

import java.util.Objects;

/**
 * ClassName: Programmer
 * Package: priv.ln.team.domain
 * Description:
 *
 * @Author 辣辣
 * @Create 2025/4/17 18:19
 * @Version 1.0
 */
public class Programmer extends Employee{
    private int memberId;//成员加入开发团队后在团队中的ID
    private Status status = Status.FREE;
    private Equipment equipment;

    public Programmer(int id, String name, int age, double salary, Equipment equipment) {
        super(id, name, age, salary);
        this.equipment = equipment;
    }

    public int getMemberId() {
        return memberId;
    }

    public void setMemberId(int memberId) {
        this.memberId = memberId;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public Equipment getEquipment() {
        return equipment;
    }

    public void setEquipment(Equipment equipment) {
        this.equipment = equipment;
    }

    @Override
    public String toString() {
        return super.getInfo() + "\t\t程序员\t" + status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        Programmer that = (Programmer) o;
        return memberId == that.memberId && status == that.status && Objects.equals(equipment, that.equipment);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), memberId, status, equipment);
    }
}
